#include "mylistwidgetitem.h"

MyListWidgetItem::MyListWidgetItem(QPixmap *icon, QColor *color,
                                   QString strType, QString toolTip,
                                   QListWidget *parent, int type)
    : QListWidgetItem(parent, type)
{
    _color = *color;
    _type = strType;
    QPixmap pixmap = QPixmap(ICON_WIDTH, ICON_HEIGHT);
    QPainter painter(&pixmap);
    QRect rect = QRect(0, 0, ICON_WIDTH/2, ICON_HEIGHT);
    painter.drawImage(rect, icon->toImage());
    QIcon icon_pom = QIcon(*icon);
    setIcon(icon_pom);
}

QColor MyListWidgetItem::color()
{
    return _color;
}

QString MyListWidgetItem::typeMy()
{
    return _type;
}


QString MyListWidgetItem::myToolTip() const
{
    return _toolTipe;
}
